package com.aaa.controller;

import com.aaa.entity.Student;
import com.aaa.service.StudentService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy173-springboot03
 * @description:
 * @author: 闫克起
 * @create: 2024-04-16 17:07
 **/
@RestController
@RequestMapping("student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @PostMapping("/list")
    public Result list(Integer current, Integer pageSize){
        return studentService.findAll(current, pageSize);
    }

    @PutMapping("update")
    public Result update(@RequestBody Student student){
        System.out.println("~~~~~~~~~~~~~~~~~~~~"+student);
        return null;
    }

    //1. 测试controller的api接口: 查询GetMapping  添加:PostMapping  删除操作: DeleteMapping  修改操作：PutMapping
    //风格restFul风格： 根据不同的操作设置不同的请求方式。
    //我们可以使用postman|apiFox|apipost工具。https://www.postman.com/downloads/
}
